window.onload = function(){
	var requestUrl = '/officalWebsite/admin?method=login';
	var lgBtn = document.querySelector('.btn');
	EventListener.addEvent(lgBtn, 'click', function(){
		var inputs = document.querySelectorAll('.form-control');
		var adminName = inputs[0].value;
		var password = inputs[1].value;
		ajax({
			method : 'post',
			url : requestUrl,
			async : true,
			data : {
				'adminName': adminName,
				'password': password
			},
			success : function(data){
				if(data!=""&&data!=null){
					location.href = '/officalWebsite/admin/main.html?k='+data;
				}else{
					alert('登陆失败，请重登！');
				}
			}
		});
	});
}